<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
	<script type="text/javascript" src="${pageContext.request.contextPath }/resources/js/customer/adposition/list.js"></script>
<div class="page-header">
	<shiro:hasPermission name="adposition:add">
	<button id="btnAdd" type="button" onclick="webside.common.addModel('/adposition/addUI.html')" class="btn btn-primary btn-sm">
	  	<i class="fa fa-user-plus"></i>&nbsp;添加
	</button>
	</shiro:hasPermission>
	<shiro:hasPermission name="adposition:edit">
	<button id="btnEdit" type="button" onclick="webside.common.editModel('/adposition/editUI.html')" class="btn btn-info btn-sm">
		 <i class="fa fa-pencil-square-o"></i>&nbsp;编辑
	</button>
	</shiro:hasPermission>
	<shiro:hasPermission name="adposition:delete">
	<button id="btnDel" type="button" onclick="webside.common.delModel('/adposition/deleteBatch.html', customSearch)" class="btn btn-danger btn-sm">
		<i class="fa fa-trash-o"></i>&nbsp;删除
	</button>
	</shiro:hasPermission>
	<shiro:hasPermission name="adposition:adrelease">
	<button id="btnEdit" type="button" onclick="webside.common.editModel('/adrelease/listUI.html')" class="btn btn-info btn-sm">
		 <i class="fa fa-pencil-square-o"></i>&nbsp;投放广告
	</button>
	</shiro:hasPermission>
</div>
<div class="input-group">
     <input id="searchKey" type="text" class="input form-control" placeholder="广告位名称">
     <span class="input-group-btn">
         <button id="btnSearch" class="btn btn-primary btn-sm" type="button"> <i class="fa fa-search"></i> 搜索</button>
     </span>
</div>
<div class="row" style="margin-top:5px;">
	<div class="col-xs-12 widget-container-col ui-sortable"
		style="min-height: 127px;">
		<!-- #section:custom/widget-box.options.transparent -->
		<div class="widget-box transparent ui-sortable-handle"
			style="opacity: 1; z-index: 0;">
			<div class="widget-header">
				<h4 class="widget-title lighter">广告位管理</h4>
				<div class="widget-toolbar no-border">
					<a href="#" data-action="fullscreen" class="orange2"> 
						<i class="ace-icon fa fa-arrows-alt"></i>
					</a> 
					<a href="#" data-action="collapse" class="green"> 
						<i class="ace-icon fa fa-chevron-up"></i>
					</a>
				</div>
			</div>

			<div class="widget-body" style="display: block;">
				<div class="widget-main padding-6 no-padding-left no-padding-right">
					<input id="pageNum" type="hidden" value="${page.pageNum }">
					<input id="pageSize" type="hidden" value="${page.pageSize }">
					<input id="orderByColumn" type="hidden" value="${page.orderByColumn }">
					<input id="orderByType" type="hidden" value="${page.orderByType }">
					<div id="dtGridContainer" class="dlshouwen-grid-container"></div>
					<div id="dtGridToolBarContainer" class="dlshouwen-grid-toolbar-container"></div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">

	function changes(obj){
		var $this=$(obj);
		var status=$this.parent().parent().find("td").eq(7).text().trim();
		var statu='';
		if(status=="已显示"){
			statu='隐藏';
		}else{
			statu='显示';
		}
		layer.confirm('确认'+statu+'吗？', {
			icon : 3,
			title : statu+'提示'
		}, function(index, layero) {
			var opid=$this.parent().parent().find("td").eq(2).text().trim();
			 var params={};
			if(status=="已显示"){
				params["status"]="none";
			}else{
				params["status"]="block";
			}
			params["id"]=opid;
			$.ajax({
				type:"post",
				dataType:"json",
				url:"${pageContext.request.contextPath }/adposition/changestatus.html",
				data:params,
				success:function(data){
					if(data.success){
						
						if(status=="已显示"){
							$this.text("已隐藏");
							$this.css("color","red");
							layer.msg('修改成功，现已隐藏！', {
								icon : 1
							});
						}else{
							$this.text("已显示");
							$this.css("color","green");
							layer.msg('修改成功，现已显示！', {
								icon : 1
							});
						}
					}else{
						layer.msg('修改失败！', {
							icon : 0
						});
					}
				}
				
			}); 
			layer.close(index);
		})
		
	}
</script>

